package com.kaki;

import com.kaki.service.GrpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

/**
 * @author  Ge Hui
 */
@SpringBootApplication
@Configuration
public class Application implements CommandLineRunner {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    @Autowired
    private GrpcService grpcService;

    @Override
    public void run(String... strings) throws IOException, InterruptedException {
        grpcService.start();
        grpcService.blockUntilShutdown();

    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}
